Conversation
a2e9c52 to
a3bbf87
Compare
a3bbf87 to
e55bb73
Compare
e55bb73 to
14d7003
Compare
f5213da to
d936d54
Compare
d936d54 to
bc7040e
Compare
| let digest = D::digest(P::Io::serialize_output(&output).unwrap()); | ||
| assert_eq!(&*digest, public_values) | ||
| assert_eq!(&*digest, &public_values[..digest.len()]); | ||
| assert!(public_values[digest.len()..].iter().all(|byte| *byte == 0)); |
There was a problem hiding this comment.
Because ZisK now outputs fixed 256 bytes public values, so here we check the rest of the bytes to be zero.
| } | ||
| } | ||
|
|
||
| fn assembly_files_exist(elf_hash: Hash) -> bool { |
There was a problem hiding this comment.
Inlined the ASM files existence check because the exported function requires a ELF path.
| let _ = Command::new("fuser") | ||
| .args(["-k", "-9", "23115/tcp", "23116/tcp", "23117/tcp"]) | ||
| .output(); | ||
| sleep(Duration::from_secs(1)); |
There was a problem hiding this comment.
Forcely remove the process to make sure recovery from ASM services panic.
| /// Merkle root of ROM trace. | ||
| pub type ProgramVk = [u8; 32]; |
There was a problem hiding this comment.
Renamed from RomDigest, ZisK calls the value ProgramVk now
| } | ||
|
|
||
| info!("Command `cargo-zisk check-setup --aggregation` succeeded"); | ||
| fn compute_program_vk(elf: &[u8]) -> Result<ProgramVk, Error> { |
There was a problem hiding this comment.
Inlined the cargo-zisk rom-setup because there is no method exported to do so directly
| let mut aligned = ManuallyDrop::new(vec![0u64; data.len() / 8]); | ||
| bytemuck::cast_slice_mut(&mut aligned).copy_from_slice(&data); | ||
| let ptr = aligned.as_mut_ptr().cast::<u8>(); | ||
| let len = aligned.len() * size_of::<u64>(); | ||
| let cap = aligned.capacity() * size_of::<u64>(); | ||
| // SAFETY: `ptr` came from a `Vec<u64>` allocation. | ||
| unsafe { Vec::from_raw_parts(ptr, len, cap) } |
There was a problem hiding this comment.
Previously the way (to_vec()) actually doesn't guarantee the bytes to be aligned, so here we need to use Vec::from_raw_parts with ManuallyDrop to make sure the alignment is preserved.
| /// Returns `data` with a LE u64 length prefix and padding to multiple of 8. | ||
| /// | ||
| /// The length prefix and padding is expected by ZisK emulator/prover runtime. | ||
| fn length_prefixed_and_padded(data: &[u8]) -> Vec<u8> { |
There was a problem hiding this comment.
Now ZisK requires input to be prefixed with u64 LE length, and padded to multiple of 8
| CommonError, Input, ProgramExecutionReport, ProgramProvingReport, Proof, ProofKind, | ||
| ProverResource, PublicValues, zkVM, zkVMProgramDigest, | ||
| }; | ||
| use mpi as _; // Import symbols referenced by starks_api.cpp |
There was a problem hiding this comment.
To run the rom_merkle_setup we have to initialize the MpiCtx, however if mpi is enabled it the MpiCtx can't be initialized twice, so we disable the mpi feature by disable_distributed.
However, there is still some code references the mpi symbols, so here we still need to import it..
| c: input.c.wrapping_mul(input.a as u32).wrapping_add(1), | ||
| d: input.d.wrapping_mul(input.b as u64).wrapping_add(1), |
There was a problem hiding this comment.
ZisK prover panics when some AIR has empty trace, so here we add some multiplication operation
bc7040e to
fa3983b
Compare
jsign
left a comment
There was a problem hiding this comment.
LGTM! Left some nit comments/questions.
| fn uninitialize(mut prover_and_pk: MutexGuard<Option<(ZiskProver<Asm>, ZiskProgramPK)>>) { | ||
| info!("Uninitializing ZisK prover..."); | ||
|
|
||
| let _ = Command::new("fuser") |
v0.16.0. Resolves Updatezisktov0.16.0#308SubscribeToProofto allow subscribe to proof completion/failure update, previously it only supports webhookzisk-sdkinstead of usingcargo-zisk. Resolves Use ZisK's SDK #73CompilerimplRustRv64imawith target spec as json (supercedes Add rust stock compiler. #107, which has ZisK's stock rust compiler left unmerged)